<!-- saved from url=(0029)http://watin.sourceforge.net/ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="ProgId" content="VisualStudio.HTML">
		<meta name="Originator" content="Microsoft Visual Studio .NET 7.1">
		<script language="javascript">

function reportId(element) {
    report = document.getElementById("Report");
    report.value = "button.id = " + element.id;

    buttonValue = document.getElementById("eventButtonValue");
    buttonValue.value = window.event.button;
    
    scrElement = document.getElementById("eventScrElement");
    scrElement.value = window.event.srcElement.value;
    
    return true
}

function ShowConfirmDialog() {
     var answer = confirm('Do you want to do xyz?');
     report = document.getElementById("ReportConfirmResult")
     if (answer == true)
         report.value = "OK"
     else
         report.value = "Cancel";
}

function ShowAlertDialog() {
     alert('This is an alert!');
}

function keyDown() {
    checkbox = document.getElementById("chkKeyDown");
    checkbox.checked = true;
    return true
}
function keyPress() {
    checkbox = document.getElementById("chkKeyPress");
    checkbox.checked = true;
    
    keycodes = document.getElementById("txtKeycodeId");
    keycode = window.event.keyCode;
    charfromkeycode = String.fromCharCode(keycode); 
    keycodes.value = keycodes.value + charfromkeycode;
    
    return true
}
function keyUp() {
    checkbox = document.getElementById("chkKeyUp");
    checkbox.checked = true;
    return true
}
 
function fnOpen()
{
   window.showModalDialog("TestEvents.html", "", "") 
} 

function injectElement()
{
    window.setTimeout(function() 
    {
      div = document.getElementById("injectElementDiv"); 
      div.innerHTML = "<div id='seconddiv'><input type=text id=injectedTextField value='Injection Succeeded' /></div>";
    }, 3000);
}

function removeElement1()
{
    window.setTimeout(function() 
    {
      div = document.getElementById("textFieldToRemoveDiv"); 
      div.innerHTML = "";
    }, 3000);
}

function removeElement()
{
    window.setTimeout(function() 
    {
      div = document.getElementById("textFieldToRemoveDiv"); 
      div.removeNode(true);
    }, 3000);
}

function ClickHref()
{
    text = document.getElementById("hrefclickresult");
    text.value = "success";
}
		</script>
	</head>
	<body>
		<P>
			<INPUT type="button" value="Button without id" onkeydown="return reportId(this)" onclick="return reportId(this)"><INPUT id="Report" type="text" name="Report" style="WIDTH: 280px; HEIGHT: 22px" size="41">&nbsp;
			<label>Event.button value <INPUT id="eventButtonValue" type="text" style="WIDTH: 40px; HEIGHT: 22px" size="1"></label>
			<label>Event.scrElement.uniqueid value <INPUT id="eventScrElement" type="text" style="WIDTH: 40px; HEIGHT: 22px" size="1" NAME="Text1"></label>
		</P>
		<P>
			<INPUT id="confirmdialogid" onclick="javascript:ShowConfirmDialog()" type="button" value="Show confirm dialog"><INPUT id="ReportConfirmResult" type="text" style="WIDTH: 432px; HEIGHT: 22px" size="66">
		</P>
		<P>
			<INPUT id="alertdialogid" onclick="javascript:ShowAlertDialog()" type="button" value="Show alert dialog">
		</P>
		<p>
			<INPUT TYPE="Button" NAME="cmdClickMe" VALUE="VBScript MsgBox" ID="vbScriptMsgBox" />
			<INPUT type="text" id="msgBoxButtons" value="0" /> <INPUT type="text" id="msgBoxReturnValue" value="" />
			<SCRIPT FOR="cmdClickMe" EVENT="onClick" LANGUAGE="VBScript">
			msgBoxReturnValue.value = MsgBox("WatiN VbScriptMsgBoxDialogHandler test.",msgBoxButtons.value)
			</SCRIPT>
		</p>
		<p>
			<input id="textfieldid" type="text" onkeydown="javascript:keyDown()" onkeypress="javascript:keyPress()"
				onkeyup="javascript:keyUp()"> <label><input type="checkbox" id="chkKeyDown"> KeyDown</label>
			<label><input type="checkbox" id="chkKeyPress"> KeyPress</label> <label><input type="checkbox" id="chkKeyUp">
				KeyUp</label> <INPUT id="txtKeycodeId" type="text">
		</p>
		<P>
			<input id="modalid" onclick="fnOpen()" type="button" value="Show this page in modal dialog"
				name="popupmodalname"></P>
		<P><INPUT id="injectElement" onclick="injectElement()" type="button" value="Inject element after 3 seconds">
		</P>
		<P>&nbsp;</P>
		<div id="injectElementDiv">Inject Element here to test Element.WaitUntilExists</div>
		<P><INPUT id="removeElement" onclick="removeElement()" type="button" value="Remove element after 3 seconds">
		</P>
		<P>&nbsp;</P>
		<div id="textFieldToRemoveDiv"><input type="text" id="textFieldToRemove" value='Element to be removed'></div>
		<a href="javascript:ClickHref()" id="hreftest">Link with javascript in Href</a><input id="hrefclickresult" type="text" />
	</body>
</html>
